#include "spline.h"
#include "function.h"
/*
class Function
{
public:
    Function() {}
    vector<double> operator()(vector<double> _x)
    {
        vector<double> _y;
        int N = _x.size();
        for (int i = 0; i < N; i++)
        {
   
            _y.push_back(3*cos(_x[i]));
        }
        
        return _y;
    }
    double operator()(double _x)
    {
        return (3*cos(_x));
    }
    double df(double _x)
    {
        return -3*sin(_x);
    }
    double ddf(double _x)
    {
        return -3*(cos(_x));
    }
};*/

int main()
{
    Function f1;
    /******/
    int N ;
    cin >> N;
    double pi= acos(-1);
    double a =-pi/2, b = 3*pi/2;
    vector<double> x, y,theta;
    double h = (b - a) / (N - 1);
    for (int i = 0; i < N; i++)
    {
        x.push_back(a + h * i);
    }
    y = f1(x);
    ppform s1(x, y);
    //s1.complete_cubic(f1.df(x[0]), f1.df(x[N - 1]));
    s1.specified_sec_diff(f1.ddf(x[0]),f1.ddf(x[N-1]));
    s1.Draw_Spline_with_Matlab_Code();

    return 0;
}